﻿using System;

namespace EmbeddedLanguage.Attributes
{
    [AttributeUsage(
        validOn: AttributeTargets.Class,
        AllowMultiple = true,
        Inherited = true
    )]
    public class StaticFunctionBinding : Attribute
    {
        private Type _BindType;
        public Type BindType
        {
            get { return this._BindType; }
            set
            {
                if (!typeof(IBindToObject).IsAssignableFrom(value))
                {
                    throw new InvalidCastException("MethodBinding.BindType must implement IBindToObject");
                }
                this._BindType = value;
            }
        }
    }
}
